# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: farseerfc <farseerfc@gmail.com>

pkgname=glmark2
pkgver=2023.01
pkgrel=1
pkgdesc="An OpenGL 2.0 and ES 2.0 benchmark"
arch=('loong64' 'x86_64')
url="https://github.com/glmark2/glmark2"
license=('GPL3' 'custom:SGI')
depends=('libjpeg-turbo' 'libpng' 'libgl' 'systemd-libs')
makedepends=('meson' 'systemd' 'wayland-protocols')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('8fece3fc323b643644a525be163dc4931a4189971eda1de8ad4c1712c5db3d67')

build() {
  arch-meson $pkgname-$pkgver build \
    -Dflavors=x11-gl,x11-glesv2,x11-gl-egl,drm-gl,drm-glesv2,wayland-gl,wayland-glesv2
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"

  cd $pkgname-$pkgver
  install -Dm644 COPYING.SGI -t "$pkgdir"/usr/share/licenses/$pkgname/
}
